﻿using blackhouse.AspQuartzWrapper;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml.Serialization;

namespace blackhouse.StareKino.QuartzActions {
    public partial class CreateEmptyQuartzConfig : System.Web.UI.Page {
        protected void Page_Load(object sender, EventArgs e) {
            QuartzJobSetup setup = new QuartzJobSetup();
            setup.CronTriggerSchedule = "0 0/5 * * * ?";
            setup.JobAssembly = "blackhouse.StareKino.QuartzActions.ReservationClientMailAction, blackhouse.StareKino.QuartzActions";
            setup.Name = "Wiadomości e-mail do klientów";
            XmlSerializer serializer = new XmlSerializer(typeof(QuartzJobSetup));
            FileInfo fi = new FileInfo(Server.MapPath("~/QuartzSetup/reservation-client-mail.config"));
            using (FileStream fs = fi.OpenWrite()) {
                serializer.Serialize(fs, setup);
            }
        }
    }
}